import http from '@/utils/http'

//获取试卷列表
export function getTestPaperListApi() {
    return http({
        url: 'test-paper/list',
        method: 'get',
    })
}
//根据id获取试卷详情
export function getTestPaperByIdApi(id) {
    return http({
        url: `test-paper/detail/${id}`,
        method: 'get',
    })
}
//新增试卷
export function addTestPaperApi(data) {
    return http({
        url: 'test-paper/save',
        method: 'post',
        data: data
    })
}

//修改试卷
export function updateTestPaperApi(data) {
    return http({
        url: 'test-paper/update',
        method: 'put',
        data: data
    })
}
//删除试卷
export function deleteTestPaperApi(id) {
    return http({
        url: `test-paper/delete/${id}`,
        method: 'delete',
    })
}

//查询试卷未包含的题目列表
export function getTestPaperNotQuestionListApi(id) {
    return http({
        url: `/test-paper/question-not-list/${id}`,
        method: 'get',
    })
}

//查询试卷包含试题列表
export function getTestPaperQuestionListApi(id) {
    return http({
        url: `test-paper/question-list/${id}`,
        method: 'get',
    })
}

//统计试卷的总分
export function getTestPaperTotalScoreApi(id) {
    return http({
        url: `test-paper/total-score/${id}`,
        method: 'get',
    })
}